package com.service.impl;

import com.bean.Booking;
import com.dao.BookingMapper;
import com.service.BookingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Component
@Service
public class BookingServiceImpl implements BookingService {

    @Autowired
    private BookingMapper bookingMapper;

    @Override
    public int save(Booking booking) {
        return bookingMapper.insert(booking);
    }

    @Override
    public int remove(Booking booking) {
        return bookingMapper.delete(booking);
    }

    @Override
    public int modify(Booking booking) {
        return bookingMapper.update(booking);
    }

    @Override
    public List<Booking> find(Booking booking) {
        return bookingMapper.select(booking);
    }

    @Override
    public int count(Map<String, Object> map) {
        return bookingMapper.selectCount(map);
    }

    @Override
    public List<Booking> query(Map<String, Object> map) {
        return bookingMapper.selectByPage(map);
    }
}

